Yes, because the USB connector has specific pins for data and power.
The old USB 2.0 and below used 4 pins, which were +5v, Data+, Data-, and Ground. USB-C uses 24 pins - 4 ground pins, 4 power pins, 12 data pins, etc.
A USB A to C cable has the GND pin on the A connector connected to all 4 of the GND pins on the C connector, and the VBUS pin on the A connector connected to all 4 of the VBUS pins on the C connector, but the two Data pins are only connected to the two USB 2.0 data pins (A6 and A7) on the C connector.
So, if the Data pins don't make good contact, but the VBUS and GND pins do, the phone will charge...albeit at the slow 5 volt rate. I assume when you plug it into the charger, it doesn't charge rapidly?
Make sure there isn't lint or dirt buildup in the USB port of your phone. Use a small thin plastic pick to gently scrape out any crud that might be in there around the connector. Don't use any harsh chemicals or solvents; you can use a small amount of isopropyl alcohol to help clean if necessary.