The two main causes of low stain resistance is an improper paint and an unprepared surface. Paints that leave a rough film usually accumulate dust and look dirty with time. Moreover, they absorb liquids that come in contact with them. It is of no use washing such painted surfaces. Secondly directly painting an unprimed surface that is porous leaves a rough paint coat after drying. Such a surface does not resist stains.
A good quality latex paint forms a smooth film that does not accumulate dirt and colors. Moreover such paint can be washed to remove stains. Good quality paints contain binder in the right quantity. The binder helps to form a paint coat, and is responsible for the smoothness and sheen of the dried paint coat. New surfaces must be primed to make them smooth and allow the paint coat to adhere to the surface. This provides high stain resistance and also makes the paint scrub resistant.