They both use similar ingredients, but a jam usually has a much higher sugar content than a compote. Jams are often reduced for longer until very thick, while compote stay somewhat liquid.