In chemistry, a salt is an ionic compound that can be formed by the neutralization reaction of an acid and a base. Salts are composed of related numbers of cations (positively charged ions) and anions (negative ions) so that the product is electrically neutral (without a net charge).
The table salt we eat is much more than NaCl, it is iodized and has chemicals added to it that make it freely pouring in humid weather as well.
Whereas NaCl used in labs is just NaCl.
And it is strongly advised not to eat or even taste it, as it has not been made with the intention of use as a food product and may be contaminated with other chemicals that might be harmful to humans.
Chemists / students in labs don't mind interchanging scalpels and other tools used with harmful chemicals with supposedly harmless ones, so the next NaCl bottle you see in a Chemistry lab may be contaminated with some chemical like mercuric chloride and you would definitely want to keep it away from your mouth.