Brick is very porous - when you paint it, the paint actually gets into those pores, as well as in between the grains of sand in mortar, and into the brick itself.