Off the top of my head I think it's basically using the same publicly undocumented API that the Twitter-hosted front ends use - Twitter did successfully block nitter et al recently with the "must be logged in to view tweets" change but rolled that back (partly?) after Threads launched.
I surmise that to block such access by Nitter completely while keeping Twitter's own front ends open to the public, Twitter would need to be extensively re-factored on both the front and back ends, a goal that the organization may not be capable of successfully completing at this time, but is presumably working towards.