Why was the IAF pilot held in custody by Pakistan without war?

Recently, India conducted ‘”non-military preemptive” air strikes on terror camps in Balakot in Pakistan. We repeat- on terror camps! However, just after a day, Pakistan responded by sending its jets into India. In this, both the countries lost an aircraft each. According to India, a MiG-21 fighter jet was shot down and a Wing Commander went missing.

After that, Pakistan shared pictures of the captured pilot Wing Commander Abhinandan Varthaman. Now the Pakistani PM Imran Khan says that his country will shortly release an Indian pilot it captured, calling it a “peace gesture”. Indian Air Force including every Indian is looking forward to the return of the Wing Commander.

Now the question that arises-why was the pilot held in the Pak custody? Was there a war going on between the two countries? Why the hell on earth Pakistan sent its jets into India when the fight was against terrorism and not Pakistan? How could the IAF pilot be declared as the Prisoner of War (POW)?

How could Pakistan release his videos? It was absolutely against the Geneva Convention which prohibits POWs from being intimidated and insulted and be subjected to public curiosity. India strongly objected to Pakistan’s vulgar display of an injured IAF pilot in violation of all norms of International Humanitarian Law and the Geneva Convention. Now, Pakistan PM says “It will release him as peace gesture”. The country which is accused of being harboring terrorists by many countries in the world. Please share your views.