I then realized that what was going on was an attack, and a major war! The beetle, like all ground beetles, likes a snail diet, and was attacking this one.
This was an amazing drama that we watched for a while. The beetle was attacking the snail, which produced the froth in self-defence.
Whenever the beetle approached the snail, it would get caught in the froth and would go off with a little bit in its mouth.
You can see this here:
The snail obviously had nowhere to go, given its speed of locomotion, and its postition at the end of the twig. It had to fight.
Having got just a mouthful of froth for its efforts, off the beetle would go, up the twig, try to get rid of it, and return to the fray,er, froth!
Such miniature fights-to-the-death happen all the time, around us...in the parks, in our own gardens. All it needs for some dramatically interesting moments is a little observation!