Yes, this is most likely a trivial evolutionary acquisition of hominids, unless you have a strong case for the opposite.
But cats are afraid of cucumbers, for example. So it's quite a trustworthy mechanism.
Phobias are disorders that can be treated. The only principle you should be guided by when treating your phobia is whether it gets in the way of your life. If fear makes you change your lifestyle, then this should be treated.
For example, you are so terribly afraid of insects that you stop leaving the house, lose your job, and starve to death because you fear that someone might be eating. It is impossible to completely get rid of a phobia, but a specialist will help you live with it, adapt to it. The most common phobia is transport. It's about a city dweller, of course. A normal person cannot enjoy traveling on the subway, because it is stuffy, crowded, there is a lot of ground above you, and so on. Here the question arises: if you can build your life in such a way as to avoid the subway and move around the big city freely - please. If there is no such possibility, then the question arises: who controls your life: you or a phobia?