A 10-2 AWG wire can carry up to 30 amps of electricity.
When you install a 10-2 wire it can handle 50 amps but only for a short time such as on startup.
However if you have something is gonna pull 50 amps on startup you likely need a 50 amp circuit breaker and should use the 8 AWG wire size.
Copper also carries more amperage than aluminum does and smaller copper wire can safely carry more amps than larger aluminum wire.
10-2 AWG Copper wire is rated for 30 Amps in most installations.
50 Amps calls for 6 AWG Copper wire or 8 AWG high temperature cable.
12-2 copper wire carries up to 20 amps on 120 volts but you can also use 12-2 wire to run 220 volt circuits which means that 12-2 copper wire can then carry the 30 amps just fine.
I have 12-2 copper wire on my electric water heater.
I was concerned but it has been fine and never has the wire heated up.
I consulted with an electrician about it and he said that it was not recommended to install 12-2 wire on the water heater but it is safe to do so.