Short form of reference. A held pointer to something rather than the thing.
Clipped from reference, from Latin referre (to carry back): re- (back) + ferre (to carry); a ref, like the word it shortens, is a pointer that carries you back to something rather than the thing itself.
A held pointer standing in for reference, carrying none of the thing itself. Naming the pointer by only three letters changes nothing about what it points at.