While learning about I-beams I became curious to know if there is any relation between the flange length and web thickness of I-beams or if its arbitrary.
The answer is "Yes", and the direct source to find such relationship is from the technical publishing, that offer steel design tables/charts showing the most optimum beam/column sections for certain load with respect to the length of the beam column.
The image below is an example of a chart comparing moment capacity (indicated on the left axis) of beam sections with respect to the unbraced length indicated on the bottom. While there are many sections will satisfy either constrain, there is only one that will satisfies both constrains with the least "weight", which often is the focus of optimization.
You can also make your own calculation to find the most optimum cross section for the constrains you have in mind. For instance, You want a section can resist a set of loads, moment and shear, yet having the least weight. In realizing the stress formulas, $f_b = My/I$, and $f_v = V/A_w$, and the facts that $I$ (moment of inertia), and $A_w$ (effective area of the web for shear) must be kept constant to yield the constant stresses due to the given set of loads, now is the simple mater by writing the equations for $I$, $A$ and $A_w$ ($A$ is area of the entire cross section), and plug in varies combination of $b_f$, $t_f$, $d$, $t_w$ that will yield the constant $I$ and $A_w$, yet the $W = r \cdot A$ is the minimum.
Hope this helps.