Oil is forced out of the earth during the primary recovery process due to:
Natural pressure build-up inside the earth.
High pressure is built-up in the oil well due to layers of rocks above them. When a well is digged, it releases oil with great pressure. This is similar to air being released when a balloon is punctured.