"A" is used to express contrast
Это мальчик, а это девочка.(Он -она) - This is a boy, and this is a girl.
Это дом, а это собака (что? – кто?) - This is a house, and this is a dog.
Он говорит, а она слушает (говорит- слушает) - He speaks, and she listens.
"НО" serves to express the opposition, emphasizes the contradiction with the assumption, which can be made on the basis of the previous statement.
Я плохо говорю по-русски, но понимаю хорошо. - I do not speak Russian well, but I understand well.
Я слушаю, но не понимаю. - I listen, but do not understand.
Русский язык трудный, но интересный. - Russian language is difficult but interesting.