USB Charging is actually somewhat of a complex thing. The issue is with the USB consortium not building power profiles until after they were being used. And the desire of some hardware designers not wanting to require digital negotiation before power output.
Apple's USB interface uses a resistor voltage divider on the D+ and D- data lines to pull them to various voltages. They have setups for a few currents as iPhones and iPads required different charging currents. Most USB connections can provide up to 500 mA of current. The max is around 2.1A of current for proprietary setups, but this is right on the edge of what microUSB plugs will handle without melting. The USB standard tops out at 1.5A for dedicated power ports.
The more common standard was shorting D+ and D- together at the charger. The device connects one side to ground and the other with a high resistance to 5V. If the pulled high line is grounded, then they know it is connected to a power port and it charges.
If you plug a device into a computer or Xbox, you will get a 500 mA trickle charge. You might also get less if the device doesn't recognize the power supply's digital line negotiation (although most provide 500mA regardless now, since too many devices don't negotiate due to cost of manufacture). USB3 moved to 900 mA for the devices like computer's USB port. However, if you plug USB3 into a USB2 port, you are limited to that 500 mA
USB ports are protected with heat based resettable fuses. PTC (Positive Temperature Coefficient) fuses will increase resistance dramatically when past a certain current, to block flow and keep from melting power traces to the USB. So if a device tries to get too much power from a computer port, the power will be cut off. After the PTC cools, power flow will be possible again.
Until USB-C, USB was always 5V and there is no danger (other than slow or no charging) in using chargers with other devices. USB-C now allows a much higher voltage to get more power into laptops and such (up to 100W instead of the USB 10W). The worse case of using a different charger is that through incompatibility, you will be limited to a 500mA charge and take 3 times as long. For certain devices (like iPads and larger tablets) they might refuse to charge altogether with a limited power supply. This is due to issues with slow charging lithium and plating that occurs to lower capacity.
Photography is my part time job. Designing hardened tablets for missionary work is my full-time job.