Suppose you have several marbles and suppose I want to know how many how you have.
I could ask "Which marbles do you have?" (SELECT size,description FROM marbles) and you could say:
"I have a small blue one, a medium red one, a medium transparent one with a yellow swirl in it, and a large white one with colored spickles on it"
I could then recount what you said and determine how many you have (mysql_num_rows()).
Or, to save you some effort (query processing time) and information (data transfer) I could have just asked "How many marbles do you have?" (SELECT COUNT(*) FROM marbles)
In which case you simply would have said "4"
As for the table lock, it is a lock that prevents any process from INSERTing or UPDATEing rows in a table while another process is INSERTing or UPDATEing a row. Because of this locking MySQL can keep track for MyISAM tables how many rows are in it and store it in the meta-data, which makes COUNT(*) fast for MyISAM tables.
This doesn't hold for InnoDB tables.
To know what kind of tables you're using do a
SHOW CREATE TABLE your_table_name;
and look for ENGINE= at the end