Transparency has to go somewhere
JPEG has no alpha channel, so every transparent pixel is replaced with something. The default in many converters is black, which is how a logo designed for a white page arrives as a white shape on a black rectangle.
Choosing the background is the fix, and the colour to choose is the one the image will sit on. If it needs to work on more than one background, JPEG is the wrong format for it — that requirement is precisely what transparency is for, and WebP keeps it while still being small.