On July 17 and July 18, the Moon was struck by two small rocks with enough energy to produce brilliant flashes of light. The two events took place almost exactly 24 hours apart and are believed to have the same cause: they are the leftover fragments of a comet.
Based on the brightness of the impact, the two meteoroids (the technical term for meteors when they are still in space) were roughly the size of a walnut. They were probably part of the dusty tail of comet 169P/NEAT, which the Earth-Moon system crosses sometime around July. On Earth, this cometary tail creates the Alpha Capricornids meteor shower. Finding the origin of these events is usually pretty difficult because astronomers witness just the flash.
Flashes of light from the surface of the Moon have been reported for 1,000 years, but in the last few decades, there have been more scientific observations of these “transient lunar phenomena”. The research project known as MIDAS (Moon Impacts Detection and Analysis System) spotted the two flashes. NASA also has a similar project, the Lunar Impact Monitoring Program, which doesn't make a great acronym.

MIDAS was started in 1997, and it has three observatories spread across Spain. The whole project has multiple telescopes, each with highly sensitive detectors that can spot changes in light on the Moon once it is hit.
“By studying meteoroids on the Moon we can determine how many rocks impact it and how often, and from this we can infer the chance of impacts on Earth," Jose Maria Madiedo from MIDAS said in a statement.
"At MIDAS we observe impacts on the ‘dark side’ of the Moon, meaning impact flashes stand out against the dark lunar ground.”
The meteoroids hit the dark side of the Moon, currently not illuminated by sunlight. This is not to be confused with the far side of the Moon, the large area that always faces away from our planet. The MIDAS observatories monitor the near side of the Moon but focus on the regions that are in the shadow of the Earth where impacts are visible.