It is well known that while everyone has roughly the same capacity of visual working memory, expertise in an area drastically alters our efficiency in utilizing that memory. For example, chess masters are much better than novices at recalling chess positions when they look like typical middle-game positions, but they perform nearly the same as novices on random arrangements of pieces [1]. In the rubik's cube case, the expert is not memorizing 54 individual squares, but rather they are taking advantage of learned patterns to store fewer, larger chunks.
For another example, consider memorizing strings of letters: Which one do you find easier? GKAMIFTBW or IBMFBICIA
[1] Chase, W. G., & Simon, H. A. (1973). Perception in chess. Cognitive psychology, 4(1), 55-81.