The quills lay/slant backwards. Snake scales may help.
The porcupine would not obediently lay its quills flat for the benefit of a snake trying to squeeze it to death.