Why isn't my iPad sound working but it works when i plug in headphones?

The volume setting for the speaker may be different than the volume setting for the headphone.

The headphone jack may be bent to the position as if the headphone was plugged in.