AFAIK, China has invested considerably in controlling African port infrastructure and operations, not trade policy in the abstract. While owning a port often implies direct control over what goes through it, the converse is not true: a government can still control its own port infrastructure while being completely laissez-faire about what goes through it.
They are building the ports to control the policy, it ain’t altruistic.
China owned port can be shut down on a whim, thus giving its owner political power because closing the port would effect the nations livelihood via exports/imports.