There is only a small set of basic or innate emotions and fear is one of them. The fear response helps survival by triggering appropriate behavioral responses. It has been preserved throughout evolution.