Scientists say they’ve figured out the workings behind a visual illusion that has confounded people for at least a century.