A game is built on top of a game engine which is in turn built upon an API. So gears of war is a game built on the unreal game engine which is built upon the API of directx or openGL( plus whatever for sound, OS windowing, and input).
In the HTML5 world, impact, construct2, craftyjs, and limejs are all game engines. You use them to make games, rather than writing your own routines to deal with canvas rendering, audio, and input.