To be against something is to be touching it or opposed to it.
They both leaned against the wall.
Example picture