The answer to 'why is my drain trap' is that a drain trap can become clogged or dry, causing sewer odors to come up through the drain. Common causes include buildup of hair, soap scum, or other debris, a dried out trap, or a broken or improperly installed trap. Symptoms include foul odors, slow draining water, or even standing water in the trap.
To fix a clogged drain trap, you can try using a plunger or drain snake to clear the obstruction. If the trap is dry, you can pour a cup of water down the drain to refill it. For a broken or improperly installed trap, you'll need to disassemble the trap and either clean or replace it. If you're not comfortable doing this yourself, it's best to call a professional plumber to diagnose and repair the issue.