I have a Samsung Galaxy S10 5G. Is it important for the charger and cable to have certain specifications to utilize the 25W charging capability?
Yes and it's usually the OEM supplied / recommended charger. Reasons:
For fast charging, the charger, cable and charging algorithm running inside the Phone need to be able to negotiate the right power (voltage & current) levels to charge the phone as designed. If any of these is not as per design, you won't get the fast charge as advertised.
Charger: I don't know if your device supports Qualcomm or Exynos chip. If it is former, Qualcomm fast charger is backward compatible so any other Qualcomm charger would work but not fast charge. AFAIK, Exynos chip doesn't support this (Related what happens if you plug a non QC 2.0 device into a QC 2.0 charger?)
USB cable needs to be of right capacity as explained here, else you may not get the right charging speed.
TL:DR Go with OEM recommended charger and cable if you want fast charging.