兹 as a phonetic component Wiktionary explains the two glyph origins of 「兹」 as the following:


  
  Unorthodox variant simplified from 茲 with 䒑 as the top component instead of 艹 found in the Ming dynasty orthographic dictionary 《俗書刊誤》.
  Variant form of 玆 with 䒑 instead of doubled 亠 as the top component. Found in the Tang dynasty orthographic dictionary Ganlu Zishu 《干祿字書》, which lists both 兹 and 茲 as unorthodox forms of 玆. 
  


For characters in the phonetic series 「兹」, most sources (from my experience) explain the characters as semantic 「X」 + phonetic 「茲」. To illustrate, here is a part of the entry for 「滋」 from Chinese Linguipedia:


  從水，表示與水相關；茲聲，表示音讀。


And below is the entry for 「滋」 in 說文解字:


  益也。从水茲聲。


However, it seems that there are two seal script forms; one that matches the structure 「水」 + 「茲」 (left), and the other matches the structure 「水」 + 「玆」 (right).




Compare the seal script forms of 「茲」 and 「玆」 respectively:




It also appears that abbreviated 「絲」 was the original phonetic component in older forms like oracle bone script, and was later replaced with 「茲」 or 「玆」. Both of these characters have the Fanqie spelling of 子之切, but seem to have different origins.

As a phonetic component, were both 「茲」 and 「玆」 used, and later converged into 「兹」? Or is there a different story behind it?
商甲鐵178.2合集11606西周金沈子它簋蓋集成4330篆部・說文解字隸定　

The character was originally「」, largely used as a phonetic loan for Zhengzhang OC: /*ʔsɯ/, meaning this (now written as「茲」).「」came from a variant way of writing「絲」(/*slɯ/, silk).



Later on,  horizontal lines or「Ｕ」shapes as differentiating marks were added to the top portion of「」, just below the notches, possibly to differentiate the original character from a myriad of other uses in the Zhou period (proper nouns and other phonetic loans). These additions ambiguously formed what is now written as「玆」or「茲」, which are really just variant shapes of each other:

東周・秦石鼓　篆玄部・玆說文解字隸定　

戰國・楚簡・帛緇衣・13郭店楚簡篆艸部・茲說文解字隸定　

Some other readings associated with「」or「玆」to note:


Reading「」as「幽」(concealed > dark) is either an erroneous interpretation of「」as the phonetic component of「幽」, or saying that originally「」had another pronunciation.
Reading「玆」as black should be a phonetic loan for「緇」(/*ʔsrɯ/, black silk).
Reading「玆」as「玄」(/*ɡʷeːn/, black, dark) is the association of「玄」with「玆」. In this sense,「玆」can be viewed as another character, formed by reduplicating「玄」to also represent /*ɡʷeːn/, and unrelated in sound etymology to /*ʔsrɯ/.




Continuing on for the morpheme /*ʔsɯ/ (this), the two「亠」on top of「玆」were sometimes joined to form「䒑」:

秦簡為吏之道51睡虎地秦簡隸定　


  Alternatively,「䒑」is also a brush calligraphy variation of「艹」. Today, several character variations are due to swapping「艹」with「䒑」or vice-versa, the most prominent being「著」and「着」which were both originally corrupted from「箸」.




The character development timeline should then be「」,「玆・茲」,「兹」. Although this cannot directly answer the question as to why sometimes「茲」is preferred over「玆」or vice-versa as a phonetic component, from the historical development it is possible to see that the facts behind character structure and development was very concealed to later writers, influencing the muddled choices.

If you really had to choose one component or the other out of「茲」or「玆」, then pending on the character, that choice is sometimes quite easy.「茲」is defined in Shuowen as


  艸木多益


while「玆」is defined as


  黑也


So, for a character like「滋」which is defined as


  益也


The obvious choice is「茲」.



References:


季旭昇《說文新證》
黃德寬《古文字譜系疏證》
小學堂
國學大師


郭沫若《甲骨文合集》
中國社會科學院考古研究所《殷周金文集成》

中國哲學書電子化計劃


宋・徐鉉等奉敕校定　漢・許慎《說文解字》