Hogwarts school trunks, like the majority of wizarding luggage, are issued with capacity enhancing or extension charms as standard. These spells not only increase the interior dimensions of objects, while leaving the outer ones unchanged, they also render the contents lighter.
The Extension Charm (‘Capacious extremis!’) is advanced, but subject to strict control, because of its potential misuse. Theoretically, a hundred wizards could take up residence in a toilet cubicle if they were sufficiently adept at these spells; the potential for infractions of the International Statute of Secrecy are obvious. The Ministry of Magic has therefore laid down a strict rule that capacity-enhancement is not for private use, but only for the production of objects (such as school trunks and family tents), which have been individually approved for manufacture by the relevant Ministry Department. Both Mr Weasley and Hermione Granger were acting unlawfully when they enhanced, respectively, the interior space of a Ford Anglia, and a small handbag. The former is now believed to be living wild in the Forbidden Forest at Hogwarts, and as the latter played no insignificant part in the defeat of the greatest Dark wizard of all time, no charges have been brought.