How does continuous integration work?
In Martin Fowler's description, every member of a team merges their changes into the shared codebase frequently, at least daily. Each integration is verified by an automated build that includes the tests [1]. GitHub's documentation puts the same idea simply: committing code to a shared repository often means errors surface sooner [2].
That check is usually triggered by an event. In GitHub Actions, a workflow can run whenever new code is pushed to the repository, and the test results show up in the pull request, so you can see whether a branch introduces an error before it is merged [2].
Where did the practice come from?
Continuous integration was originally developed as part of Extreme Programming. Fowler credits Kent Beck with defining it in the 1990s [1].
What happens when the build breaks?
Fowler says a failed integration build should be fixed straight away, quoting Beck: nobody has a higher priority task than fixing the build [1]. Say a morning commit breaks one of the tests. The team either fixes the fault at once or reverts the commit, and Fowler often recommends reverting, because it lets everyone else keep working on a healthy codebase [1].