I was reading about it in Bulbapedia and it didn't make sense for a while, but now I get it thanks to some other reading. *coughMarrilandcough*
A Pokemon's personality value determines many of its characteristics. There are 2^32--or 4,294,967,296--of them, and it's pretty much randomly generated in hexadecimal digits. If the last 4 digits of Wurmple's personality value is divided by 10 and the REMAINDER resulting from that is less than 5, then Wurmple will evolve into Silcoon--otherwise it'll become Cascoon. The actual odds of one over the other, from what I've been able to find, are 6554:6553 in favor of Silcoon.
(EDIT: The odds are that way because the last 4 digits will have a hexadecimal value from 0-65,535 and dividing it by 10 will result in 32,770 of them with remainders less than 5 & 32,765 will have a remainder 5 or more.)
In lamen terms, Wurmple's evolution is randomly determined when acquired and uncontrollable.
EDIT: And here I was originally thinking that the location of where the Wurmple was caught determined that. Add that to the growing list of things Serebii is wrong on. (It's not dependent on the time of day!)