Interesting find badge!
This race flew under the radar for me, but I'll spitball a little.
In a state where HDs are small as this, campaigns tend to be pretty small and ramshackle. But Baldes's campaign looks to have been unusually active.
Here's a write-up about the race from Reason.Baldes ran in 2012 but got 5% of the vote (in a race featuring D and R candidates, unlike 2018 which was only R vs. L). Her vote total in 2018 roughly matches the non-R vote totals from 2012. It seems plausible that a massive share of D voters in the district (who these voters are is interesting - the district covers all of a very small city on a reservation but is only 10% native ancestry) crossed over to support Baldes. Meanwhile because 2018 was generally a D wave, R turnout was pretty depressed (Miller got 700-800 fewer votes than 2012) making the final margin very close.
Ballotpedia.
Super interesting to see such large D support for a libertarian candidate who tried running to the right of the R incumbent. Guess if I lived in Riverton I would vote for anybody who would potentially weaken the R position statewide even if a supermajority was still guaranteed.