Security checks do not follow any certain pattern.
If airlines or an administration feel the need they can 'make it so' and it is unlikely that they will explain why.
Some airlines carry out their own checks "at the gate" - I've experienced this several times in wider Asia with QANTAS where they had their own team and XRay machine in the boarding lounge. Also with one or more other airlines.
"Worst case" I flew QANTAS to NZ from Asia and transited Sydney (in Australia). We were asked to leave the plane and take our carry-on luggage, then within a short period (under an hour) we boarded the same plane but were subject to an "at the gate" security check with Xrays. They may just have heard some only semi muffled comments from my direction. (I'd probably avoid that further from home but in OZ they expect Kiwis to be stroppy and assertive - if not quite up to Australian standards :-) ).
At Pune domestic airport (bound for New Delhi) we were subject to a security check with bag XRays on entering the terminal prior to reaching the check-in counter. But, on the return trip at New Delhi there was no XRay machine at the entrance, but they had a sand-bagged machine gun post on the aerial approach road, armed soldiers at the doors and in the terminal, and declined my request to venture outside (to take photos) once I was inside.
At Chennai railway station they had a manned XRay machine at the entrance but passengers were not being checked, they had armed soldiers here and there and an (unmanned) sandbagged machine gun nest commanding a view down the platforms. Two bombs exploded on an incoming train standing at the platform a few weeks after I passed through there (nobody hurt) so the randomness of security checks is actually somewhat reassuring.
In Mumbai at the 'Taj Mahal Palace' hotel adjacent to the 'Gateway to India' (location of a major terrorist attack some years ago) an armoured car stands permanent watch outside and guards check you in and out through security. (It took them a week+ and too many lives to clear the 'bad guys' out last time.)
So, standards vary, they do it because they think it's a good idea AND because they can, and hopefully if you can't see any predictable pattern in it then the "bad guys" also will not be able to.