It listens to changes within your source files and sends them, and only them, to the browser (or mobile device, for React Native). When those changes arrive at the browser, the code segment that has changed is being “injected” into its module, replacing the previous code.
Full article