What I understand is that when make a push, my code in the remote repository gets updated. How does git actually keep track of the versions of the release (in context of git
It updates remote tracking branches (branches in the remotes namespace).
Those have the last SHA1 fetched from the remote in them.
See "Git: What is a tracking branch?"
This isn't limited to "git-flow", it is a basic git mechanism.