you need to set up a sections.xml inside etc/frontend of your module that tells Magento which sections to update for a given Ajax call. Here is an example;
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
<action name="[frontName]/[ActionPath]/[ActionName]">
<section name="cart"/>
</action>
</config>
After my Ajax call has finished to [frontName]/[ActionPath]/[ActionName] Magento makes another call to /customer/section/load passing the sections to load.
By default it requests any messages but if you have set up your sections.xml correctly you will also see the section names you have defined in there as well.