Byond (supposedly) uses the base C implementation of rand(), which varies upon platform
glibc (GCC, most popular c compiler iirc) uses a Linear Congruential Generator
GCC uses the constants 1103515245, 12345 and 2^31 -1, meaning the random number produced is seed2 = 1103515245 * seed1 + 12345 % 2^31 -1
When the very first RNG number is produced, seed1 is the world.time value at that time (which is a value in deciseconds (1/10 of seconds))
seed2 is your pseudo random number, which will then be used as the seed1 for the next number
at any point however you can call random_seed(some_seed) to change the value of seed1
As with all seeded pseudo random number generators, this means that if the events play out in the exact same order, then you will get the exact same sequence of numbers.
Here's some C# code where I've (attempted) to implement byond's rand() using GCC's constants for an LCG
http://rextester.com/AGRFG97976
Running this (without changing the seed I chose, 42) will get you:
5 rand() calls (0,1) //rand() with no args in DM means "give me a value between 0 and 1", though as you'll see in the C# code the max is actually the highest possible 32 bit integer value
Next Seed: 1,250497E+09 Normalised: 0,5823079 //(You get commas here because Rextester is german, and europeans do it that way for some reason (I know they're german because during testing I got 'unendlich' which is german for infinity))
Next Seed: 7,669473E+08 Normalised: 0,3571377
Next Seed: 6,20245E+08 Normalised: 0,2888241
Next Seed: 9,851494E+08 Normalised: 0,458746
Next Seed: 4,482785E+08 Normalised: 0,208746
5 rand(1, 10) calls //I don't trust the numbers in this section much, as I hate normalising numbers to begin with, but it's still an ok-ish example.
Next Seed: 1,250497E+09 Normalised: 8
Next Seed: 7,669473E+08 Normalised: 8 //~byond rng~
Next Seed: 6,20245E+08 Normalised: 2
Next Seed: 9,851494E+08 Normalised: 1
Next Seed: 4,482785E+08 Normalised: 8 //too many 8s
A fun seed to try is 45, which for rand(1,10) TRULY summons byond rng by producing 8,8,4,8,8 (Which is how we end up with WIZARD, WIZARD, TRAITOR, WIZARD, WIZARD, WIZARD, WIZARD...)
If you feel like it, try and find a seed which produces the same number 5 times)
As you can see, the dreaded "Byond rng" has produced the same number 3 times out of 5, but that's just what you get with a simple PRNG like LCGs.
I haven't tested if these are the exact numbers byond produces, but it's a decent enough example of an LCG.
I hope this helps you with understanding (P)RNGs, if you REALLY want to go on this (imo unnecessary) venture, I would look into implementing a mersene twister
Also sorry if parts of this are a bit scatter brained, I wrote this in one go over a lunch break.