There are a lot of different factors that come into play. Onpage seo, backlink building, unique content, seo ready themes, etc.
So many factors affect the PR. Like quality back links means back links from high PR pages, Site age, site reputation, site regularity means how much time server stays down and other factors. PR affects SERP but little bit. It's not mean that high PR sites rank high. Low PR sites can rank high. Don't work to get high PR, work for high SERPs.