Primary dates

Given that so many primaries and caucuses for the two parties in each state are on the same day, are these dates set by the state or by the state’s political parties?

Since primary elections are facilitated by the state governments, the dates are determined by state law.

With caucuses, I believe it varies with different states having differing levels of involvement in the process.

Caucus dates are set by the parties, and the two parties in a state will often caucus on different dates. When they match, it just means the parties agreed on the same date; see for example this story about Iowa.