  Low-temperature measurements of the magnetocrystalline anisotropy energy $K$
in (Fe$_{1-x}$Co$_{x}$)$_{2}$B alloys are reported, and the origin of this
anisotropy is elucidated using a first-principles electronic structure
analysis. The calculated concentration dependence $K(x)$ with a maximum near
$x=0.3$ and a minimum near $x=0.8$ is in excellent agreement with experiment.
This dependence is traced down to spin-orbital selection rules and the filling
of electronic bands with increasing electronic concentration. At the optimal Co
concentration, $K$ depends strongly on the tetragonality and doubles under a
modest 3% increase of the $c/a$ ratio, suggesting that the magnetocrystalline
anisotropy can be further enhanced using epitaxial or chemical strain.
