One is to cover an expense for when you die earlier than expected/suddenly. Term insurance is relatively inexpensive and is used to cover mortgages and loans as well as to protect families. Term insurance usually expires at a certain age and can be purchased for a set price for a set number of years. It does not build cash value.
The second type of insurance is a universal or whole life product that is designed to build cash for your beneficiaries when you die. This is a permanent product that costs more because it is designed to pay out every time. The main difference is that permanent insurance does not expire at a certain age whereas most term products do.