The variables that factor into that ranking are too many to count. They include a websites title, its URL structure (see permalinks), the structure of the web page HTML, the quality and quantity of the content on a site and which other websites link to the web pages on the site.
There are numerous WordPress plugins that assist website owners with optimizing their content and settings for good SEO. Some of the more popular ones include Yoast SEO, All in One SEO Pack and the SEO modules in Jetpack. If you’re willing to pay for it, there are also plenty of agencies that can help you with analysing and optimizing your website for better SEO performance.