I think this example will clear your doubt.
Let’s say Nick searched for [bacon] and URLs from your site appeared
in positions 3, 6, and 12. Jane also searched for [bacon] and URLs
from your site appeared in positions 5 and 9. Previously, we would
have averaged all these positions together and shown an Average
Position of 7. Going forward, we’ll only average the highest position
your site appeared in for each search (3 for Nick’s search and 5 for
Jane’s search), for an Average Position of 4.
Extra example -
If I type laxmi temple in Google India, and I see your site in 1st position, and someone from US type same query and see your site in 3rd position, then average position will be (1+3)/2 = 2
Here not only GEO (location) affect search position, but user devices (like User agent + Device size), language (like US, UK, IN English) also affect search position, hence Google display the average position on search report.
Also the data displayed in search analytic report is not real time, Google might show you one week older data, so the current average position might not 100% accurate.
But I'm getting better ranking of a keyword with less position value
It's probably because when you search some query then you see second position while other see your site in 5th or 6th,7th position. So here the average position might be higher than 4+, but the ranking(position) for you is better(here is 2nd).
You can get visitors information like device, user-agent, location etc, and then you can apply same thing in your browser, and search same query, then you will get an idea, on which position your site is ranking for others.