Was it developed in tandem with the United States' westward expansion, or was it the product of late 19th/early 20th century reminiscing, or an invention of mid-20th century Hollywood? Was it conjured by something else entirely?
More can always be said, but /u/Bernardito wrote a stellar answer on the creation of a mythos about the 'Wild West' concurrent with the "frontier period" itself, so I would definitely recommend checking it out!