Wasp and bee venom are quite different chemically, but they both contain peptides (amino acid chains) that have evolved specifically to cause pain in other animals. The social bees and wasps use this to defend their nests; the solitary ones, just to discourage predators from eating them. Honeybee venom contains a peptide called melittin that directly activates the pain receptors in your skin.
Could you neutralize a bee sting with a wasp sting?
Although bee venom is slightly acidic and wasp venom slightly alkaline, the difference is largely coincidental. Neither insect relies on the pH of their venom for any destructive power. A typical sting injects less than 50 micrograms of venom, so even quite concentrated acid or alkali would barely be noticeable. Instead, the venom comprises a complex cocktail of proteins that stimulate the production of the stress hormone cortisol, destroy cell membranes, raise the heartbeat and inhibit blood clotting. Bee and wasp venom differ in the specifics of the proteins involved but their general effect is the same. They certainly don’t neutralize each other: if you somehow managed to be stung by one of each on the same spot, you would just feel twice the pain.