Fennel tastes like black licorice because of the fact that they both share very similar chemical structures. In particular, there is one compound that both fennel and black licorice have that is identical. This is the compound called anethole and it is what gives these products their recognizable flavor profile.
As we have already discussed earlier in this article, the compound called anethole is what contributes to the very distinctive taste shared by fennel and licorice. Anise also shares the same flavor. This is very sweet, warming, and slightly bitter. As such, these flavors are often mistaken for each other and can be used to substitute each other in recipes. That being said, this does also mean that if you dislike one flavor, such as licorice, that you may dislike other flavors such as fennel and anise as they taste so similar.