It's actually more the relevance of the content to the search term. If a search term is not competitive you can rank with shorter articles. The more competitive the search term the longer the article "usually" needs to be.
Plus, longer articles seem to get shared more and linked to.
When I look at my stats, my long articles always outperform my short ones. Look at your stats and see how yours compare.
Keep in mind that short articles can rank high when they answer a very specific question and the answer does not have to be long to satisfy the searcher.
To answer this question, you need to understand why Google prefers long content.
Google wants users to access maximum information in the shortest time possible. Hence if you write a 2000+ word article covering every aspect about that topic, Google may reward you by giving a higher ranking in the search engine. Google algorithms view each user as a researcher and when analyzing your content it asks whether this content can be used by a student for their research purpose? If the answer is yes, it ranks your blog higher. If you are a digital marketing agency, you can post 2 in-depth articles rather than 4 short articles.
Yes, longer posts tend to outrank shorter ones. It's not just the length of the post but also the response from your visitors. If they engage and read through your article, that also gives you a boost in the rankings.
Google wants the most relevant content for the searcher and they want the searcher to get what they were looking for so if you have more content then the other pages in the top 10, and people spend some time reading your article you will go up in ranking.
If you have a long post and as soon as someone sees it, they exit your site to find something else, google sees that as an indication that your content is not good or relevant so you will lose ranking, so it is not just about length but user engagement plays a part also.
If your content has a high keyword density than it's definitely going to work against you. Because Google penalises the web pages that stuff huge number of keywords into themselves.
So it'd be better if you stuff only optimum amount of keywords into your webpage.