They did not agreed on using certain sounds for specific things. They already did that on their own languages, each with their specific sounds. What the Phoenician Alphabet did was transcribing those sounds that already existed to a writing system that was common.
The Phoenicians did not invent the alphabet but they used it so much that developed it a lot. They used it for communication as a Lingua Franca for commerce in the Mediterranean.
It actually became a language on its own. They will use a native word from the native language of some particular good or commodity and then everybody around the Mediterranean Sea will use that written name and sound for referring to that thing.
It was extremely useful, so people used it more and more creating over time latin and greek scripts.