The PWM pins use a built in timer to generate the square wave. While in theory, the same thing could be achieved without a PWM pin, these pins are specifically connected to do so.
The other pins can be "hacked" to do the same thing, but it's complicated.
Both types of pins can also be used as "traditional" Digital I/O pins with HIGH or LOW settings.