I can’t seem to find the history of it, but it essentially means somethings a bit rubbish, bad, or crap.
Pants are typically underwear in Britain, we wear trousers (Jeans, chinos, suit trousers) over our pants (boxers, y-fronts, briefs) so probably not something you’d want to show off that much.