So oil drops, the stock market rises. Then a while later, the reverse happens. What's going on?

The first thing, and often forgotten, is straightforward. If enough people take money out of commodities (oil) and put it into stocks, or vice versa, that increases prices where the money goes, and drops it where it leaves. That's part of the mechanics of the situation. It doesn't answer "why" but it is important to remember that volatile rises and falls in markets are due to what amounts to financial plumbing - move money from one part of the system to another and levels fall and rise.

Second. Commodity prices are negative to the real economy, not just because they increase prices, but because of how inflation fear really works -- not so much of inflation per se, but of the Fed's reaction to inflation. If commodities are going up too much, inflation will probably follow. Then the Fed has to raise interest rates, with the intention of crushing the economy into the dirt in order to reduce demand therefore reducing inflation. So if inflation looks bad, get out of stocks and into commodities, thus making it worse. If inflation looks better, then suddenly stocks look better.

Which is far oversimplified, but it's one lens to look at stock movements through. The other, simpler way is to ignore daily movements and concentrate on longer term movements. Bear markets often have very sharp rises and falls, and it really doesn't mean much. If it turns to a bull market, that matters. Likewise, oil has fallen to its May price, but it's still plenty high. I wouldn't read that much into it, though the fast increases and decreases indicate to me that there's a lot of "hot money" involved in moving oil prices and not just fundamentals.