This feature of a character take its roots in national mentality, as Russians have always been helpful and mindful. Many traditional proverbs represent such behavior attitude to others.
For example, it is said, that you should treat people only in a way that you want to be treated yourself.
Moving back in history, long time ago people used to live in communities having close neighborhood. Therefore, it was natural to establish friendly and supportive relationships and make it possible for people to rely on each other. It made life in survival conditions much easier.
Moreover, in the past, receiving a guest or a foreigner was really a noticeable event in routine life. It was rare and strange in some way. The purpose of hospitality was quite obvious, as after his staying the stranger will return home and tell to his friends or family about the places he visited.
The reputation of the family has always been on the first place. One can even not eat enough but when a guest come to your house, you must amaze him by number of dishes and the service. The foreigner was provided with everything of the highest quality.
Apart from this, not everything can be explained in terms of private benefits and kind of a competition between communities or families.
People behave in this way also because of the feeling of genuine goodwill. Since time immemorial people in Russia do it thanks to moral component. Not the least argument for being so open-minded to others and always be ready to help is national features of a collective mind.
People are still not used to the idea that everyone is just living private life. There are dialogues between neighbors or strangers in public transport, in queues and so on.
You will not be ever a stranger if you are within Russian people. Do not be afraid to ask anything necessary Russians will help you!
When you are in St Petersburg you should experience traditional Russian dinner in the Russian family or private guided tours around St Petersburg and its suburbs.