As knitters we can all sympathise with this. It's extremely annoying to have to undo a knot and start the row again, joining the new strand. We've all been there.
Unfortunately, knots are something that can occur during the manufacturing process and they will allow up to five knots per 50g ball for it to pass their quality control and go out for sale.
A knot can be caused by the yarn breaking while it is made, or when a new cone of yarn is added to continue making the yarn. When either of these things happens the yarn will be joined with a knot.