@Sumit Yadav, Thanks for posting in Q&A.
Based as I know, in Intune, compliance policy can detect Jailbroken/rooted devices and app protection policy can block them to access work or school account data. Here are the links with more details:
https://learn.microsoft.com/en-us/mem/intune/protect/compliance-policy-create-ios#device-health
https://learn.microsoft.com/en-us/mem/intune/protect/compliance-policy-create-android-for-work
But how it detected in the background, it is not mentioned in our official document. You can open case to see if you can get more help.
https://learn.microsoft.com/en-us/mem/get-support
Thanks for your understanding.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.