For he that speaketh in an unknown tongue speaketh not unto men, but unto God: for no man understandeth him; howbeit in the spirit he speaketh mysteries. 1 Corinthians 14:2 KJV
There are things that God does not share with everyone. There are things hidden in His heart that are only shared with those who are walking in covenant with Him in obedience to His Word.
Only those who obey His instructions and guidance are given “ears to hear”.
And, being assembled together with them, commanded them that they should not depart from Jerusalem, but wait for the promise of the Father, which, saith he, ye have heard of me. For John truly baptized with water; but ye shall be baptized with the Holy Ghost not many days hence. Acts 1:4-5 KJV
Praying in the spirit makes you privy to divine secrets and mysteries.