Tannin is used to assist the mordants of cellulose fibres and fabrics. Alum does not bond very well with cellulose fibres. However, tannin bonds well with cellulose and once treated with tannin, alum will combine with the tannin-fibre complex. Many dyestuffs contain tannin (black oak, pomegranate, cutch, fustic, oak gall etc.) and do not need an additional tannin.
Tannins can be clear or they can add colour to the fibre, and this is an important consideration when selecting a tannin. Experiment with different tannins and find the one that works best for the colours you like.