TLDR the main purpose of the grid fins is to steer the spent 1st stage away from populated areas when it's falling to the grond.
CZ-4B targets SSO and is mostly launched from T-SLC (Taiyuan Satellite Launch Center). China currently operates 4 SLCs, T(Taiyuan), J(Jiuquan), X(Xichang) and W(Wenchang). While J-SLC launches into the desert and W-SLC into the ocean, spent rocket parts (strap-on boosters, rocket stages, payload fairings) from T-SLC and X-SLC do fall onto populated areas and has been a pain since day 1 of their operations.
This is the news piece from Xinhua News Agency on 2019-11-3 regarding the grid fins on CZ-4B Y38. I'll try my best to make a translation (Translating from official Chinese news source is hard).
Xinhua News Agency, November 3rd (2019), reported by Hu Zhe. We have known from CASC that, on November 3rd, a CZ-4B launch vehicle that was developed by 8th Institute of CASC was launched successfully, putting a spacecraft into planned orbit. This launch mission also completed successful demonstration and verification of 1st stage falling zone control based on grid fin system.
According to relevant experts at 8th Institute, the grid fin used in this flight is a new type pf highly efficient aerodynamic stabilizer and control surface. It has very good lift characteristics. It is installed folded, close to the surface of the rocket body and unfolds when in use. Its presence does not affect the flight mission. The successful flight experiment of the grid fin system will significantly improve the safety of the (1st stage) falling zone. It also lays solid foundation for the development of future vertical landing reusable launch vehicle.
In recent years, with the development of the society and domestic economy, the safety of the falling zone attracts great public attention. The 1st stage grid fin falling zone control system is like adding a pair of "smart and agile wings" to the previously uncontrolled 1st stage, such that the size of 1st stage falling zone is reduced by more than 85%. This will tremendously improve the safety of the falling zone, and to a considerable degree, avoid large scale evacuation of personnel, loss of life, and damage to property. (The use of such system) is the inevitable choice (by CASC) to fulfill social responsibility and develop a eco-friendly aerospace enterprise.