I hate to call them a pest, but I have had lots of little red compost worms inside cabbages, celery and leeks. Perhaps the surface compost on the beds was too fresh?
Kev.
Kev it may be that, they love half rotted organic matter: I saw a lot here in year one.
Another reason for their appearance is that some of your veg may be over-mature with some decaying bits, which is what they like to help decompose.
At least they are not hurting.