The use of the crown hardly needs explanation, the stars (now commonly referred to as "pips") were miniature replicas of the Orders of Chivalry, Garter for the Guards and a few others (Thistle for Scots Guards, St Patrick for Irish Guards), Order of the Bath for the rest. So no direct link to heraldry, but rather to Orders of Chivalry.