Chemistry studies what matter consists of and the changes that convert it into different matter.
Physics studies how energy interacts with mattter without converting it into a different type of matter.
When water turns into ice, it is still water, but it is in a different physical state. If we place water in the freezer it will turn into ice, and if we take it out and wait until it warms up, it will turn back into water.
If we heat up water in a saucepan and let it turn into steam, we will see drops of water appear on the walls or windows. This is steam turning back into water when it cools down. Water is only changing state, but it remains water.
When we run an electric current through water, the gases that we see are hydrogen and oxygen, which are two different substances.