Once many aeons ago the shoggoths were created by Elder Things as mindless slaves, used for underwater construction purposes.
But through many eons they slowly developed consciousness and became restless. They killed the Elder Things.
While most shoggoths are dead by now, it is said that in the depths of some Antarctic caves penguins routinely go missing, and you may hear the distant cries of "Tekeli-li! Tekeli-li!", a phrase shoggoths learned from their former masters.
You can find out more about shoggoths on the H.P. Lovecraft Wiki