They get grouped together and priced apart. The difference is in how they form and how they behave under a lamp and a knife.
Onyx is a banded calcite laid down slowly in caves and springs, which is why it can be translucent enough to backlight. Marble is limestone recrystallised under heat and pressure — denser, more uniform, more forgiving.
Onyx is jewellery: dramatic, delicate, best where it won't be scrubbed daily. Marble is architecture. Match the stone to the wear, not just the look.
Whichever you pick, read the care guide first.