Why people invented a torch?

It is a source of light.

BTW "torch" is the word used in Britain (and a few other countries) for what Americans call a "flashlight".

A torch is a way to light a cave. They are also used as a symbol for people follow. They use a torch in the Olympics showing "spirit."