The meaning is very similar, but there is a grammatical difference:
denn is used for a main clause, weil for a subordinate clause.
Karin kam zu spät zur Arbeit, denn ihr Bus hatte Verspätung.
Karin kam zu spät zur Arbeit, weil ihr Bus Verspätung hatte.
Karin came late to work, because her bus was late.