AP classes seem to have taken the place of the CLEP test (from eons ago) as an avenue for college credits. The classes are given an extra weight of 1.0 to the GPA (make an A and it's worth 5 rather than 4 points). Taking AP classes shows rigor and adds to your GPA for college apps.
Since colleges give college credit for them, it's a bit like doing dual credit courses. Any college credit you can get transfers into dollars in your pocket.
No, they aren't taught the same everywhere (GPA and homework load) but your score on the test (college credit) is the same so hopefully a harder taught AP class translates into a higher grade on the AP test (and therefore college credit). Teachers pride themselves on how well their students do on the AP exams.