Your question was about deer hunting in Pennsylvania and Oregon where the majority of the deer are whitetail deer and mule deer, respectively. My answer applies to both, generally. There are many other species of deer, and I am not referring to them here. Also, the answer to your question is very complicated. I'll try to keep it short.
Before a game department can design any deer hunt, whether rifle, archery, or any other, they must understand the needs of deer versus the needs of other animals, including humans. Therefore, they employ biologists to help guide the process. These biologists study deer herds extensively (and most other wildlife), and provide a ton of information. Here is an example of Idaho's summary of its deer herd in 2016. (Idaho has lots of whitetail and mule deer hunting opportunities.)
It is also helpful to hunters to understand, at least basically, the needs of deer and their resulting behaviors. Following is a short summary of deer behavior and how it changes throughout the fall months:
Deer change their behavior throughout the year due to weather, food sources, breeding, and hunting, among many other reasons. These factors change quickly in autumn, when most hunting seasons take place, and easily change deer behavior. I like to break autumn into four main "seasons" of deer behavior: 1. Late-Summer; 2. Transition; 3. Rut; and 4. Winter.
In Late-Summer, which is mostly the month of September, deer are still acting as they typically would during summer: scattered and mostly relaxed. This is because food is plentiful, the weather is excellent, and even though there are a few hunters out and about in early hunting seasons, most humans in the woods are just camping and hiking and not pursuing the deer.
During Transition, late-September through late-October, the weather is growing cold, food sources are changing (some are dying and others are maturing), and more hunters (and fewer hikers/campers) are in the woods. The deer congregate more near food sources, but can quickly become nocturnal to avoid hunters who are more active and spread out away from roads and main trails.
From late-October through mid-November, the Rut is on (varies a little by region). Bucks seek out does, often in small herds (whitetail and mule deer herd behavior is different), and are often traveling during daylight hours. They are less wary and easier to find.
By late-November, Winter is usually setting in. There is a second rut in December for the minority of does that were not bred in November, and the bucks who sniff them out. For the majority of deer, however, the rut is over and they continue in earnest to build fat for winter. Most bucks did not eat much during the rut and have already burned through some of their winter fat. Both bucks and does travel more during the day, especially during good weather, in search of whatever food is left so they can store as much winter fat as possible.
Game departments have many different issues (varies tremendously by location) to think about when they are planning when and how long to hold deer hunts, in addition to which type of weapon to allow. In one state, a hunter will usually find dozens, if not hundreds, of different hunts to choose from - categorized by date and geography. One hunt area might offer a hunter a tiny sliver of a chance in some type of lottery system just to get the opportunity to hunt, while another area might offer the hunter the chance to shoot multiple deer in one day (the hunter often must choose one hunt or the other in any given year - cannot hunt both). These hunts are designed to help game departments reach their objectives, which usually are directly related to population but can also be related to moving deer out of certain locations, like farmers' fields. (Idaho - which I'm most familiar with - holds a lot of these types of hunts during August when many early crops are maturing. Many states also hold depredation hunts, rifle or archery, which target local populations that are too high and are either causing property damage or the deer will starve if numbers aren't cut drastically and immediately.)
Now, with this information in mind, we can attempt an answer to the question of holding an archery season before or after a rifle season. The short answer varies tremendously by area. If it's been a good year for deer and there are way more deer than the land can support through the winter, then they could schedule the rifle hunt (where total harvest is usually much higher) to coincide with those times when deer are easier to find, ie. more congregated and traveling/feeding during the day. That would be during the later "seasons" Rut and Winter, and sometimes at the earliest "season" of Late-Summer. However, if deer populations are only a little high, the rifle hunt would normally be held during Transition, when fewer campers/hikers are in the woods and deer are more congregated but often quickly go nocturnal. If deer populations are about right or a little low, the rifle hunt will likely be during Transition and will be short, sometimes only a day or two - or may be cancelled altogether. (Deer reproduce quickly, so this only happens when some other factor is very abnormal, such as drought, disease, predator overpopulation, etc.)
Bowhunting, on the other hand, usually accounts for a much smaller harvest and, therefore, archery hunts can be scheduled to cover much longer periods of time, even during "seasons" when the deer are much easier to find (Late-Summer, Rut, Winter). For example, in Oregon's 2014 deer hunt, about 166,000 deer were harvested in rifle hunts (varying lengths in October [Transition], depending on the area), and about 51,000 deer were harvested in archery hunts in the entire month of September (Late-Summer), and a few weeks in November (Rut) and December (Winter). Link for Oregon's 2014 deer harvest summary. Link for a summary of Oregon's deer hunts.
Pennsylvania also has a variety of hunts to choose from. The rifle hunts are very short and are held later: a few short hunts in mid-October (Transition), but most seem to be a few days around the first of December (Winter) and a longer one that starts at the end of December and goes into January (Winter). Archery, on the other hand, starts as early as mid-September and extends into early-November, then starts up again in late-December and goes into January. Despite these much longer hunts, covering all "seasons", archery only accounted for about 93,000 deer in 2014, while rifle hunters harvested about double, at around 190,000 deer. See these links for more information on the 2014 deer harvest and deer hunting, in general, in Pennsylvania.
In short, archery and rifle hunts are tools for game departments to manage deer populations while also allowing hunters to TRY to meet some of their own needs. The timing of archery versus rifle hunts depends on many variables, is very complicated, and varies by state.