How does the "rubbed" coating of an LCD align liquid crystal molecules?
Rubbing produces a surface alignment of the molecules in the coating of the electrode. The LC molecules then align with these though Van der Waals inter-molecular forces. Putting it simply the molecules align to find the minimum energy state between the LC molecules and the polyimide molecules.

The alignment is not caused by mechanical grooving. This is clearly shown by the axis of LC molecule alignment not being aligned in the direction in which grooves wold be formed and being different in different materials.

See this paper for more details.