You deal with it by doing couple of things in parallel:
Decouple sound sources, quiet pipes in the walls
Make sure to wrap all pipes in either soundproofing mats or just carpet underpad (that's what I did), especially where the pipes touch the framing, to reduce sound transmission directly from the pipe.
Make sure nothing rattles/moves, e.g. all pipes are securely attached.
Add more mass to the wall, reduce the sound from the bathroom itself
- Use thicker drywall, or double drywall, with Green Glue between the layers.
- Add Roxul Safe'n'Sound or similar soundproofing bats into wall cavities. This will also somewhat help with noisy pipes.
- Use acoustical sealant in all outlets or other openings in the wall.
Deal with the noisy fixtures
- Get a quieter bathroom fan, if yours can be heard outside of the bathroom.
- Make sure your water pressure is not too high, install/replace water pressure regulator if needed.
- Invest in quality plumbing fixtures. I found that cheapest faucets often make much more noise than quality ones. Same for shower head. Also, 2 gpm showerhead will typically be quieter than 2.5gpm (less water).
In any case, if someone takes a shower, it will still be heard in the room right behind that drywall. Doing all this will reduce the noise, but not eliminate it completely. I did succeed to make my basement much quieter doing basically what I wrote above, and it wasn't terribly expensive (I didn't do double drywall though), just don't expect miracles.