. . . Long ago, when life first appeared on the earth, a terrible demon terrorized the earth. He prevented sages from performing their rituals and stole the Holy Vedas, taking refuge in a conch shell in the depths of the ocean. Brahma, the creator of the world approached Vishnu for help and the latter immediately assumed the form of a fish and plunged into the ocean. He killed the demon by ripping open his stomach and retrieved the Vedas. Four forms emerged from the demon's stomach representing the four Vedas: Rig Veda, Sama Veda, Atharva Veda, and Yajur Veda.
In Hindu tradition, Vishnu manifested in a series of avatars. These occurred in response to a great evil or to enact a specific good upon the earth. The half-man/half-fish avatar is Matsya.