What did ancient and medieval and early modern science (from anywhere) think about certain scientific phenomenon? For example when salt dissolves in water what did they think was happening? I can't myself think of a way to explain it without bringing up chemistry, but they didn't have our understanding of ions and atoms. Likewise what about something like static electricity? What did they think happened when someone out of nowhere just zaps a person. There are some others as well, did any ancient scientists try to determine why oil and water don't mix? I just want to understand how people would've rationalized things like this. Thank you so much if you take the time to answer
Your question is very very very broad, both in terms of what you are asking (a bunch of random phenomena) and the time period you've specified ("ancient to medieval" is thousands of years). There's not going to be an answer that will fit in a Reddit answer.
The best we can do is say, if you are interested in understanding this, you'll have to read about the views of specific people and their theories of matter, which is what most of this falls under. Aristotle's theory of matter is arguably the most comprehensive ancient one we know of, and was very dominant for quite a long time. He described matter in terms of qualities and affinities, which could involve things like being "moist" or "dry," "viscous" or "brittle," "hard" or "soft," "rough" or "smooth," and so on. And if you drill down you can see he thinks that oil has some of these properties (oil is viscous and moist, for example) and water has different properties (it is moist but not viscous). (Water is one of his fundamental elements; oil is not, so it is a substance that is going to be some composite of water and something else.)
I am just giving you the most basic overview. It is a complicated and dense philosophy of matter. Aristotle is not asking the same questions that we ask about the world and the kind of answer he thinks is useful is not the same kind we would think is useful (he does not care at all about experiment, for example). An Aristotlean approach is one that is seeking to describe the natural behavior of things, and perhaps give an overview that explains why that behavior exists, but it takes for granted that the phenomena one experiences (like static electricity) are just aspects of how the world works.
Anyway, Aristotle is just one voice — there were other views of these things across the vast time period you have mentioned. It is important to keep in mind that the people in the past were no less clever than people are today, but often the goals of their work were quite different, and so their "science" looks quite different from ours. The way that historians approach this is not "how would they explain things we find interesting today" but more "what was their understanding of the world on their own terms?" Which is a lot harder to do, but a lot more interesting and useful.