Three different ways through which religions form are as follows:
Response to human fear: It is said that people created first religion to give people a feeling of security in an insecure world due to natural disasters.
Due to human evolution: evolution of human from proto-humans have the ability to pass on their accumulated knowledge to their next generation and so they created religions.
Stories of human existence: Different people came with their own story of human existence and created different gods and goddesses which leads to different religions.