It’s basically due to the amount of water you’ve drunk. If you’re not very well hydrated (i.e. you’re not drinking enough water), then your urine will contain a greater concentration of other waste products (such as urea), which will make it darker. If you drink a lot of water, then the excess that your body doesn’t need at that point gets passed as urine, and will dilute whatever else is in there.
It’s kind of like making a glass of orange squash – if you put lots of squash and not much water in a glass, it’ll be a really dark orange. If you put lots of water and not much squash in, it’ll be almost clear!