The explanation is that occasional individual almond trees have a mutation in a single gene that prevents them from synthesizing the bitter-tasting amygdalin.
Most wild almond seeds contain an intensely bitter chemical called amygdalin, which (as was already mentioned) breaks down to yield the poison cyanide.