We should reduce the cognitive load in our projects as much as possible. When reading code, you put things like values of variables, control flow logic and call sequences into your head. The average person can hold roughly four such things in working memory. Once the cognitive load reaches this threshold, a significant effort is required to understand things.

https://github.com/zakirullin/cognitive-load

It’s a handy rule of thumb to keep in mind when doing anything, not just writing code. In code, try keep things at the high level and not to next details within details too much. If you can make things like functions or files encapsulate all the logic they need and be as standalone as possible then the developer can ignore much of the world going on around them and focus just on the changes here. However if the function has side effects on outside code or relies on many different pieces to function then anyone will struggle to understand it.

It’s something to keep in mind when you see large files and why things should be kept fairly simple. Again it is a rule of thumb and there are situations where it can be broken but in general try keep cognitive load low