The first two lines describe how to handle texture coordinates outside of the range [0 - 1], and the following two lines describe how to handle filtering on minification (scaling down) and magnification (scaling up). The example here uses "nearest neighbour" filtering which means hard edges will be preserved (i.e. nice for "8bit retro" effect). An alternative would be GL_LINEAR which results in a smoother scaling.
Since texture wrap uses GL_CLAMP_TO_EDGE (notice it requires OpenGL 1.2), texcoords outside of the [0-1] range will use the nearest edge color.
You can change these parameters after creating your texture, e.g. if you wanted to change the filtering.
As for why the texture won't show without this code -- that's because, by default, the minification filter expects mipmaps, and since you haven't defined/generated any, the texture will be invalid (and thus won't render). If you aren't using mipmaps, then you need to use GL_NEAREST or GL_LINEAR for your min/mag filters.