These pairings are often cognates as, for example, in the context of electoral law when used in expressions such as abstenerse de votar (“to abstain from voting”) or tasa de abstención (“abstention rate”).
But in other areas of law these expressions may be false friends. In procedural contexts, a judge’s duty to refrain from hearing a case due to a conflict of interest or for other legally-established grounds is known as el deber de abstención. In this case abstención cannot be translated literally as “abstention,” but rather denotes a judge’s “recusal of himself.” When there are grounds for recusing oneself (causas de abstención), judges as well as court personnel, prosecutors and expert witnesses (funcionarios de la administración de justicia, fiscales y peritos) are obliged to recuse themselves (abstenerse). Thus, el juez se abstuvo de conocer el asunto indicates that the “judge recused himself from the case,” (rather than the literal rendering “the judge abstained/refrained from hearing the case” as it is sometimes rendered.
In other respects, both the parties to a civil or criminal proceeding and the public prosecutor (las partes y el Ministerio Fiscal) may file a “motion to recuse” or “motion for recusal” (promover incidente de recusación) if a judge does not recuse himself when deemed warranted. Thus, as indicated above, abstenerse refers to a judge’s recusal of himself, while the cognate recusar is the term used when a third party recuses a judge or other official.
It may be of interest to note that in US practice a judge may be recused (recusado) or may recuse himself (abstenerse), while “abstention” is often used to refer to a federal court’s relinquishment of jurisdiction to avoid conflict with a state court or agency.
See here for more on abstención, recusación, inhibición, declinatoria and inhibitoria