This is maybe the best explanation of how the WFC algorithm works: https://www.youtube.com/watch?v=2SuvO4Gi7uY