I've read that ash changes the PH of soil, so I was wondering how it changes the PH.
The carbonates and oxides that are left by the burning of wood can be used to neutralise acidic soil as wood ash is highly basic.
It will contain all the elements that were present in the wood except those lost as gases such as nitrogen and sulfur.
Hard woods contain large amounts of calcium whereas soft woods have very little. Interestingly North American trees used to be burnt and exported to Great Britain for their potassium carbonate content.
Wood ash rapidly leaches its nutrients when wet so it's better to use it in your compost pile if wanted for its nutrients.
Assuming this is wood ash from a wood burning stove.
As a rule of thumb, wood ash contains 15-30% Calcium Carbonate (Lime), 3-8% Potassium (Carbonate and other salts), 1-3% Phosphorus and other trace elements depending on where the wood was grown.
It changes the pH the same way as applying Lime will, being alkaline, it raises the soil pH. It's a good idea to soil test if you apply any quantity of wood ash, both for pH and for Potassium. I've seen gardens poisoned by indiscriminate dumping of wood ash, you then have to lower pH and do something to remove potassium depending on the testing.