I don't completely understand $(this).attr(..) vs $('#....')

I don't completely understand $(this).attr(..) vs $('#....')

In a function, I can use

$(this).attr('value')

to get the value from a textbox but I can't use

$('#textid').attr('value')

instead I have to use

$('#textid')[0].value

And, by the way, in the function you CANNOT use
$(this).value

What am I missing.

Thanks for the education....