This same pattern of lace had decorated French uniforms before the French Revolution began in 1789. The Bourbon kings of Spain were a branch of the French royal family, and adopted a similar livery.
This same design element had been used to embellish French military attire prior to the start of the French Revolution in 1789. The Bourbon rulers of Spain, being part of the French royal lineage, subsequently employed a similar aesthetic.