It works with every game in The Orange Box, not only Half-Life 2.
Garry's Mod draws its assets from whatever Source games you own, so having the Orange Box installed gives it access to Half-Life 2, both episodes, Portal, and Team Fortress 2. That means a much larger pool of props, textures, and characters to build with.
Own more Source titles and the sandbox gets correspondingly bigger, which is the main reason people recommend the Orange Box as the cheapest way to fill out a Garry's Mod install.