That somebody does an action only so that other people can see it, and because of now social media and mobile phones and camera, it's very easy to share everything that you do.
And the reason why some of these people, may Allah protect us, where we fall short in this issue of showing off, is that the heart has found connection in the creation rather than the Creator.