Officers insignias in the united states were originaly used by the army before spreading to the majority of uniform services either as their primary rank insignias or secondary one (that is, in addition to other forms of rank recognition).
Despite the impact that the United States Armed forces has had on other countries, it should be noted that only liberia adopted a system reminiscent of it.
The officers insignias as worn today by the ranks of first lieutenant to major general had basically the same as settled on in 1836.
The second lieutenant only received his current insignia in 1918. Before that date, the 2nd lieutenant was recognizable by the blank officer board (in branch colour bordered silver or gold) worn on his shoulders but as the US army abandoned these for everyday wear, an insignia had to be given to him.
Lieutenant General and General (using these titles or others) had been created on and off, usualy during wartime but only became a permanent fixture following WW1. Their insignias were the same as today.
Higher ranks then these were created for specific period with various insignias such as five stars or the US national emblem between 2 stars using titles such as General of the Army (or Armies). Due to an erroneously painted portrait of "General of the Armies of the United States" John Pershing, he has often been mistakenly reported to have worn 4 gold stars as an insignias of rank. There is however no evidence apart from that painting that he ever did and much evidence to the contrary.