See
https://www.frankfurt-airport.com/en/travel/transfer.detail.suffix.html/article/travel/services-a-z/easy-travel/transfer-at-fra.html
Relevant bits follow
Security Check
In most cases, you must clear security checks on your way through the airport. Please allow enough time for them. Also please observe the restrictions on carrying liquids and gels into the aircraft cabin.
...
Passport Checks
Whether or not you must clear a passport check depends on whether the airport you have arrived from and your destination are within or outside the Schengen Area.
...
You are arriving from outside the Schengen Area and your destination is in a non-Schengen country: Usually no passport check is mandatory, provided that that you do not leave the transit zone. Depending on your nationality, you may require a transit visa. If in doubt, please contact an embassy or consulate of your country.