It's usually the scaling. If you're on 27" at 4k, you probably have some scaling enabled, anywhere from 1.25x to 2x, so less stuff fits on the screen. Since less stuff fits on the screen, less stuff gets rendered and performance should be better.
At 42" 4k, there's probably no scaling, so more stuff fits on the screen.
At 42" 4k, there's probably no scaling, so more stuff fits on the screen.