(And as of Jan 1 of next year, jaywalking will no longer be an offense in California, so you can cross whenever and wherever you want, as long as it's not dangerous to do so.)
in europe generally jaywalking is only allowed if there is no marked crossing nearby. crossing at a red light is not jaywalking but a different offence that is still punished.
But cars were getting faster and more dangerous, and it was no longer compatible to have mixed traffic. Rather than ban cars from cities, we convinced people that actually, it was the car's road afterall and you shouldn't have been there!
During that time the term jay walking came about, and it was used to paint the pedestrians as the one's getting in the way of the automobile driver, rather than it being the automobile that was out of place. If we use a very cynical lens, and I think we should, it was a essentially a marketing campaign from automobile makers.
There are various markings that suggest that you probably shouldn't cross, but they aren't enforceable. Cars also have priority in many cases, but priority isn't an excuse for crashing into someone.
[1]: My right to drive a car is limited: I need a license, insurance, and permission from the owner. If I'm driving or riding a bicycle, I need to obey signage -- no jumping red lights, no going the wrong way down one way roads. If I'm walking, I'm perfectly at liberty to walk through a red light if I want to.
Relatively recently, that rule was changed in the UK, though how fast that affects actual driving behaviour remains to be seen. Meanwhile in Germany though crossing against as a pedestrian still remains illegal – the only mitigating circumstance is that unlike for vehicular infractions, the fine for pedestrians hasn't been increased and for now remains a nominal 5 € (10 € with endangerment).