The raw form of magic is known as wild magic (also known as primal magic). It lies beyond the borders of reality, but can be drawn upon by spellcasters. It is a chaotic force, and can be found in the Great Beyond in areas attuned to chaos, such as the Maelstrom and the Outer Rifts.
In Golarion, wild magic is only able to manifest in areas where the laws of reality have been weakened, most commonly in the devastated area between Nex and Geb known as the Mana Wastes. It might also occur in areas which have suffered the wrath of the gods, or when a powerful artifact is destroyed.
A manifestation normally follows an accumulation of primal energy, which then explodes into existence in the Universe. The effects are unpredictable, and range from the weird (a burst of strange music, or a rain of rotten fruit) to the dangerous (a firestorm sweeps through the area, or all creatures present are lashed by negative energy).1
For additional as-yet unincorporated sources about this subject, see the Meta page.