365 = 6,04,66,176 — about 6 crore, or 6.05 × 107.
Characters available = 26 letters + 10 digits = 36
Slots = 5, each independently filled
Total codes = 36 × 36 × 36 × 36 × 36 = 365
362 = 1296
364 = 12962 = 16,79,616
365 = 16,79,616 × 36 = 6,04,66,176
Compare: a 5-digit numeric code gives only 105 = 1,00,000. Allowing letters as well makes the locker about 600 times harder to open.
Why it happens: the examples in the question confirm that repeats are allowed (38098 repeats the 8) and that any mix is allowed, so every slot really does have all 36 choices, independently. That independence is what licenses the multiplication. If, say, the first character had to be a letter, the count would fall to 26 × 364 = 4,36,70,016.