Just the ReactFiberWorkLoop.js has 5k+ lines of code. React is one or two orders of magnitude bigger than you are thinking. And that's not counting Nextjs.
I had a quick look around and it's actually ~1000 lines apparently, in React 19.
Do you dispute that? If so, why?