Minecraft wiki entry for Chat, associated text: Some commands may also have additional parameters that may be autocompleted by pressing Tab ↹ at that point.
Certain commands that handle blocks (/blockdata, /fill, etc.) have parameters that need the x, y, and z coordinates of the target block(s). Using the Tab ↹ key when these coordinates are needed automatically adds the coordinates of the block the player is looking at.