How does a society develop language?

Specifically, how do large groups of people (eg all the Greek city states) all develop the same language. How do they teach each other new words (especially non-noun words) when they don’t have a pre existing language to teach themselves with?