How does matter behave?

first lets clarify what is matter. in its general use, matter is everything that is not virtual. example of virtual things : mathematics, ideas, philosophy...

Even "light" is matter as it can be attracted by gravity.

So, this is what matter is, its made of something.

lets go with the other part of your question.

Matter can be found basically in 3 phases (lets put aside the 4th phase: plasma)

solid, liquid, gases.

in a solid, molecules can only vibrate.

in a liquid, molecules can vibrate and rotate on each other

in a gas, molecules can vibrate, rotate and slide

(see link)

this is how matter behave.

If you want to know what happen when you mix stuff like salt in water, then this has to do with solubility, size of particle and interstice. see link for in depth explanation on "solubility".