It depends on which iPad model you have. At least the newer M4 iPads, and possibly earlier models, feature an attention awareness mode. I'm not sure if this can be disabled somewhere, but as long as your eyes are on the device—for instance, if it's in a case right in front of you—the screen will remain active. If that's not the issue, you'll need to provide more details. See also
this document from Apple.